/*
 * Copyright (c) 2024-2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION!

import { int32, float32 } from "@koalaui/common"
import { nullptr, KPointer, KInt, KBoolean, KStringPtr } from "@koalaui/interop"
import { isResource, isInstanceOf, runtimeType, RuntimeType } from "@koalaui/interop"
import { Serializer } from "./Serializer"
import { ComponentBase } from "../ComponentBase"
import { PeerNode } from "../PeerNode"
import { ArkUIGeneratedNativeModule } from "#components"
import { ArkCommonMethodPeer, ArkCommonMethodAttributes } from "./ArkCommonPeer"
import { CommonMethod } from "./../ArkCommonInterfaces"
import { FormComponentAttribute, FormDimension, FormCallbackInfo, FormInfo } from "./../ArkFormComponentInterfaces"
import { SizeOptions } from "./../ArkUnitsInterfaces"
import { Visibility } from "./../ArkEnumsInterfaces"
import { Callback_FormCallbackInfo_Void, Callback_Literal_Number_errcode_String_msg_Void, Literal_Number_errcode_String_msg, Callback_Any_Void, Callback_Void } from "./../SyntheticDeclarations"
import { CallbackKind } from "./CallbackKind"
import { CallbackTransformer } from "./CallbackTransformer"
import { TypeChecker } from "#components"
import { wrapCallback } from "@koalaui/interop"
import { MaterializedBase } from "./../MaterializedBase"
import { DotIndicator } from "./../ArkDotIndicatorBuilder"
import { DigitIndicator } from "./../ArkDigitIndicatorBuilder"
import { SubTabBarStyle } from "./../ArkSubTabBarStyleBuilder"
import { BottomTabBarStyle } from "./../ArkBottomTabBarStyleBuilder"
export class ArkFormComponentPeer extends ArkCommonMethodPeer {
    protected constructor(peerPtr: KPointer, id: int32, name: string = "", flags: int32 = 0) {
        super(peerPtr, id, name, flags)
    }
    public static create(component?: ComponentBase, flags: int32 = 0): ArkFormComponentPeer {
        const peerId  = PeerNode.nextId()
        const _peerPtr  = ArkUIGeneratedNativeModule._FormComponent_construct(peerId, flags)
        const _peer  = new ArkFormComponentPeer(_peerPtr, peerId, "FormComponent", flags)
        component?.setPeer(_peer)
        return _peer
    }
    setFormComponentOptionsAttribute(value: FormInfo): void {
        const thisSerializer : Serializer = Serializer.hold()
        thisSerializer.writeFormInfo(value)
        ArkUIGeneratedNativeModule._FormComponentInterface_setFormComponentOptions(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length())
        thisSerializer.release()
    }
    sizeAttribute(value: SizeOptions): void {
        const thisSerializer : Serializer = Serializer.hold()
        thisSerializer.writeSizeOptions(value)
        ArkUIGeneratedNativeModule._FormComponentAttribute_size(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length())
        thisSerializer.release()
    }
    moduleNameAttribute(value: string): void {
        ArkUIGeneratedNativeModule._FormComponentAttribute_moduleName(this.peer.ptr, value)
    }
    dimensionAttribute(value: FormDimension): void {
        ArkUIGeneratedNativeModule._FormComponentAttribute_dimension(this.peer.ptr, (value.valueOf() as int32))
    }
    allowUpdateAttribute(value: boolean): void {
        ArkUIGeneratedNativeModule._FormComponentAttribute_allowUpdate(this.peer.ptr, value ? 1 : 0)
    }
    visibilityAttribute(value: Visibility): void {
        ArkUIGeneratedNativeModule._FormComponentAttribute_visibility(this.peer.ptr, (value.valueOf() as int32))
    }
    onAcquiredAttribute(value: ((parameter: FormCallbackInfo) => void)): void {
        const thisSerializer : Serializer = Serializer.hold()
        thisSerializer.holdAndWriteCallback(value)
        ArkUIGeneratedNativeModule._FormComponentAttribute_onAcquired(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length())
        thisSerializer.release()
    }
    onErrorAttribute(value: ((info: Literal_Number_errcode_String_msg) => void)): void {
        const thisSerializer : Serializer = Serializer.hold()
        thisSerializer.holdAndWriteCallback(value)
        ArkUIGeneratedNativeModule._FormComponentAttribute_onError(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length())
        thisSerializer.release()
    }
    onRouterAttribute(value: ((info: object) => void)): void {
        const thisSerializer : Serializer = Serializer.hold()
        thisSerializer.holdAndWriteCallback(value)
        ArkUIGeneratedNativeModule._FormComponentAttribute_onRouter(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length())
        thisSerializer.release()
    }
    onUninstallAttribute(value: ((parameter: FormCallbackInfo) => void)): void {
        const thisSerializer : Serializer = Serializer.hold()
        thisSerializer.holdAndWriteCallback(value)
        ArkUIGeneratedNativeModule._FormComponentAttribute_onUninstall(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length())
        thisSerializer.release()
    }
    onLoadAttribute(value: (() => void)): void {
        const thisSerializer : Serializer = Serializer.hold()
        thisSerializer.holdAndWriteCallback(value)
        ArkUIGeneratedNativeModule._FormComponentAttribute_onLoad(this.peer.ptr, thisSerializer.asArray(), thisSerializer.length())
        thisSerializer.release()
    }
}
export interface ArkFormComponentAttributes extends ArkCommonMethodAttributes {
    size?: SizeOptions
    moduleName?: string
    dimension?: FormDimension
    allowUpdate?: boolean
    visibility?: Visibility
    onAcquired?: ((parameter: FormCallbackInfo) => void)
    onError?: ((info: Literal_Number_errcode_String_msg) => void)
    onRouter?: ((info: object) => void)
    onUninstall?: ((parameter: FormCallbackInfo) => void)
    onLoad?: (() => void)
}
